home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d26
/
studyaid.arc
/
Q&A.DOC
< prev
next >
Wrap
Text File
|
1990-05-17
|
20KB
|
560 lines
Q & A Study Aid
Version 1.00
January 7, 1988
Hal Endresen
Quid Pro Quo Software
150 Wellington Terrace
Lansdale, PA 19446
1
General
-------
Q & A is a general-purpose program designed to present questions
from a database. The user is then prompted for an answer and
graded accordingly.
Q&A provides two methods of reading the questions from the
database: sequential and random. The program starts up in random
mode.
A menu-driven command interface is provided with pull-down menus.
Filenames are selected from a directory by pointing. It is never
necessary to type in a filename.
Q&A sports a context-sensitive help system accessible via the F1
key. Help is provided by two support files, Q&A.HLP and Q&A.NDX.
These files may be located in the current directory or in any
directory specified in the PATH environment variable. Q&A may
therefore be placed in the \bin (or equivalent) directory and
accessed from any other directory, provided that PATH includes
\bin.
This package contains the following files:
Q&A.EXE main program file
Q&A.HLP help file
Q&A.NDX help index file
Q&A.DOC documentation file
SAMPLE.Q&A sample database
Q&A is public domain, and may be freely distributed. Please
distribute the entire archive, STUDYAID.ARC, and please do not
hack the program. The only file that may be safely modified, with
restrictions, is the sample database. The author requests no
contributions. I have received so much value from public domain
software that this is one small way to attempt to repay a large
debt.
Q&A is offered as is. There is no guarantee that it will work on
your particular system; however, it has been tested with CGA, MDA
and EGA monitors. Text mode is used; no graphics card is needed.
Command Interface
-----------------
Commands are entered into Q&A via a pull-dowm two-level menu
system. The uppermost screen reqion is the menu system. Each word
group on the menu line is the title block of a pull-down menu.
Whenever one of the titles is selected, the menu expands to
display the options available under it.
2
Under most conditions, Q&A will be prompting for an answer to a
question. Some means must therefore be provided to break out and
into the menu system so that an option can be selected. There are
two ways of doing this: via an ALT key sequence or by pressing
the menu escape character, the forward slash ('/').
If an ALT sequence is used, it is only necessary to press two ALT
keys to select any command option. The first character of each
menu level is selected by ALT-shifting the letter. For example,
the "Mode / Sequential" command is executed with ALT-M/ALT-S.
Using the '/' menu escape character, the word MENU will first
appear at the right of the menu line to indicate that you are in
the menu system. At this point, any combination of first letters
and cursor keys can be used to select a command option. Note that
F1 will always get help no matter where you may be in the menu
system. Once the desired option has been selected, RETURN
executes it. Note that RETURN is not necessary when using ALT-key
sequences.
Q&A's commands are listed below.
/FS select database
/FD specify directory containing database file(s)
/FE exit to DOS
/MS set mode to sequential
/MP set mode to pseudorandom
/MC clear score
Specify Database Directory
--------------------------
If your Q&A database files are located in a directory other than
the directory Q&A was invoked from, then you must tell Q&A which
directory to use with this command. When selected, a data entry
window will pop up and prompt for the directory name. DO NOT
enter a filename. The directory will be verified as such, and you
will receive an error if the directory does not exist. The
directory you specify need not be on the same disk drive.
However, if you give the name of a directory on a floppy disk,
you must have the floppy in the drive with the door closed or you
will get an error.
Select Database File
--------------------
This option is used to specify the name of the database file you
want Q&A to use. Once selected, a directory of the disk will
appear in a window along with a selection bar. To avoid
restrictions on the names of the database files, Q&A does not
filter these files; all files are shown except for parent and
child directories and hidden files.
To select the database file, move the selection bar to it using
3
the cursor keys, page up and down, or home and end. Each of these
permits traveling up and down the scrollable list in larger
increments. Alternatively, you may also press a letter key that
corresponds to the first character of the database filename; Q&A
will find the first file beginning with that letter. Successive
depressions of the same key will step to each filename that
begins with that letter. The search stops at the last file that
begins with that letter. The search always proceeds down the
list; to restart the search, press HOME to move the selector to
the first file in the directory.
Once you have pointed to the file you desire, press RETURN. The
file will be loaded and the first question will appear on the
screen, along with the number of questions in the database in the
scoring window. The name of the file will also be shown in the
scoring window under the "Database" heading.
To permit Q&A to utilize relatively large databases (>=3000
questions), Q&A loads an index into memory rather than the
database file itself. The database index is a file that is
created by Q&A from the database the first time the database is
used. Once created, Q&A will use the new index the next time that
database is used rather than creating a new one. This index file
will always have the same base name as the database file, but
with an extension of ".X".
The index will remain serviceable as long as the database is not
changed. If you do change the database, DELETE THE INDEX so that
Q&A will create a new one. A future enhancement will check the
modification time of the database and create a new index when
needed. Note that this arrangement permits Q&A to arbitrarily
write over an old index - so make sure you do not have any files
with the same name as the index or they will be overwritten!
You must create the database file before Q&A can be used.
Instructions for doing this are in a later section of this
document.
Exit to DOS
-----------
Use this command to quit a Q&A session and return to the
operating system command level.
Sequential Mode
---------------
The sequential mode option tells Q&A that you wish to answer the
questions in the same order as they appear in the database file.
When selected, the new mode will appear in the scoring window.
This option does NOT cause Q&A to start reading from the
beginning of the file; it simply changes the method used to
determine the next question. This is done to allow switching
4
between modes. If you go out of sequential mode, you will be
brought back to the same place in the database when you return to
it. When the end of the database is reached, Q&A will simply
restart at the beginning and continue asking questions.
Pseudorandom Mode
-----------------
This mode is used when you want Q&A to choose the questions at
random. The random number generator is seeded on each invocation
of Q&A by using the BIOS time-of-day clock to insure that the
pseudorandom sequence is different each time the program is run.
In this mode, 'end-of-file' has no meaning, since Q&A jumps
randomly around the database and presents the questions.
Clear
-----
Use the Clear option to reset your score back to zero and to
reset the sequential mode index back to the beginning of the
file. The sequential mode index is cleared only here and when the
database is initially loaded.
Scoring Window
--------------
The scoring window always shows the current state of both you and
Q&A. The items that appear in the scoring window are described
below.
Database This is the name of the database file
currently in use by Q&A. Once loaded, you
cannot remove it unless you replace it with
another one. When Q&A starts, no database is
loaded, and "[ none ]" is displayed.
Mode This is the current question-indexing mode,
and will be "Random" or "Sequential". Q&A
always starts up in random mode.
# Questions When a database has been loaded, this
represents the total number of questions in
the database.
# Asked Tells the number of questions that Q&A has
asked. Since you cannot skip over questions,
it is also the number that you have answered.
Note that this may exceed the number of
questions in the database.
5
# Correct This is the number of questions that you
answered correctly.
Score Your score is a simple ratio of the number of
questions asked to the number you answered
correctly, and is displayed in percent.
Creating a Database
-------------------
The database is the heart of Q&A. Q&A receives virtually all of
the information it needs to present and score your answers from
the database.
The database is a plain ASCII, or 'flat', file that can be
created using almost any editor. If you use a word processor to
create the database file, be sure to use its 'nondocument' mode
to insure that it won't put in a rash of formatting codes.
To enable Q&A to handle all of the common question formats except
'essay' questions, a very general database arrangement is used.
Q&A expects each question to be followed by the correct answer,
which it uses to check your answer.
Q&A can handle multiple-choice, true/false, and fill-in-the-blank
questions with equal ease.
The database must contain one instance of each of two keywords
for each question in the database. These keywords are, exactly,
in quotes:
"Q="
"A="
As you might expect, these stand for "question" and "answer". The
question MUST precede the answer. Q&A will complain about any
irregularities it finds in the database when it constructs the
index file.
The first example is a multiple-choice question. The following
text is entered into the database:
Q=
Multiple-choice:
What is the capital of Pennsylvania?
A. Philadelphia
B. Washington, D.C.
C. Harrisburg
D. None of the above
A=
C
6
What Q&A will do with this is to display the question beginning
on the line immediately following the 'Q=' line. The end of the
question is marked by the 'A='. All lines between these markers
form the question, which Q&A will display exactly as it appears
in the database. You may, therefore, format your questions any
way that you wish. Q&A will impose NO restrictions other than the
number of lines; you may use up to 15 lines. If the question is
longer than that, the extra lines will be discarded. Blank lines
following the actual question and the 'A=' line are effectively
discarded.
Note that the 'Multiple-choice' prompt is actually a part of the
database - NOT hard-coded into Q&A.
The answer follows beginning on the line immediately after the
'A='. In this example, it is 'C'. All this means is that Q&A will
score as correct any response to the question that is exactly 'C'
OR 'c' - case is insignificant. Q&A does some reformatting of
these strings, however. Both the answer in the database and the
answer typed in by you are processed the same way:
1. All leading whitespace is removed. This means that
C
and
C
are identical and are themselves identical to the 'C' in
the example above.
2. All trailing whitespace, including newline characters, is
removed.
3. All whitespace between words is collapsed to a single
space; "hello there" and "hello there" are
identical.
4. All characters are folded to uppercase; 'Yes' and 'yes'
are therefore identical.
These steps insure that a response will not be scored as
incorrect due to the position of the response in either your
answer or that in the database.
Note that these same rules are also applied to the 'Q=' and 'A='
markers. They may, therefore, appear anywhere on the line. You
cannot, however, insert anything between 'Q' and '='; nor can you
put anything else on the line with the marker.
In the example above, one correct answer was specified. The only
answer that will be scored as correct is 'C'. Note that we could
just as well have used numbers as selectors and given '3' as the
answer. Q&A makes no attempt to interpret this information; it
simply looks for an exact match based on the criteria outlined
above.
7
This next example will demonstrate a true/false question.
Q=
Answer true or false:
Q&A understands the information in the database.
A=
False
Note the (legal) position of the 'A='. This time we have indented
the question using tabs. When Q&A displays the question, it
expand the tabs automatically to maintain the alignment as it is
in the database. We also have three blank lines after the 'Q=';
this serves to shift the question down toward the center of the
question window to make it look nicer.
This example is not good practice, since the 'A=' would be easy
to miss if the database were edited, and the indentation is
inconsistent. It does, however, have a more serious drawback: to
get the question right, you must type in 'false', all 5
characters - and 'false' is one word I just cannot type.
For a true/false question, one would be likely to respond with
'T', 'F', 'yes', 'y', or possibly '1' and '0'. To accomodate
these options, Q&A allows more than one correct answer. In fact,
every nonblank line between 'A=' and the next 'Q=' is a correct
answer. The second example above, then, would be more
appropriately given by
Q=
Answer true or false:
Q&A understands the information in the database.
A=
False
F
No
N
This permits any of the four answers to be regarded as correct.
If you give an incorrect response to a question or one that is
not among the list of correct answers, Q&A will display the
correct answer for you (as well as subtract a point from your
score). When Q&A displays the correct answer, it uses the first
8
one given in the answer list (blank lines are ignored). What this
means is that Q&A will display
Incorrect. The correct answer is
False
which is more formal than 'N', for example.
This feature adds a lot of versatility to Q&A. Since Q&A is
intended to be a study aid, it should provide reinforcement of
correct answers by permitting a more complete correct answer. To
demonstrate this, we'll use a third example; this time, a fill-
in-the-blank question:
Q=
The speed of light is ______ km/sec.
A=
Light travels at 300,000 km/sec.
300000
300,000
300K
In this example, an incorrect response will elicit
Incorrect. The correct answer is
Light travels at 300,000 km/sec.
Of course, this is also a correct answer in itself, but not a
likely one. If you do enter it, it will be scored as correct. You
would be required to use the period, also.
There are three more plausible correct answers that Q&A would
consider to be correct. Any one of them is sufficient to credit
the answer to you.
Conclusion
----------
Each of these examples is reproduced in the sample database,
SAMPLE.Q&A. Experiment with it (remember to delete the index if
you change it), but don't pass on a modified copy to someone
else.
The author
9
F